<?php

function unsDepartement_getAllStaff() {
    return bab_getGroupsMembers(unsDepartement_getGroupIDByName('uns_Personnel'));
}


function unsDepartement_addStaff($lastname, $firstname, $email, $phoneNumber) {

    //if (null != $lastname && null != $firstname && null != $mail && null != $phoneNumber) {

        global $babBody;

        $password = '012345678';
        $nickname = $firstname . $lastname;

        if (bab_getUserIdByNickname($nickname) == 0) {
            $idStaff = bab_registerUser($firstname, $lastname, '', $email, $nickname, $password, $password,1,$error, $bgroup = true);
            bab_attachUserToGroup($idStaff, unsDepartement_getGroupIDByName('uns_Personnel'));
        } else {
            $babBody->addError($lastname . ' ' . $firstname . ' ' . bab_translate('allready exist', $GLOBALS['babAddonFolder']));
        }
    //} else {
       // $babBody->addError(bab_translate("All fields are required!", $GLOBALS['babAddonFolder']));
    //}
}

?>
